<?

include "../config.php";
require_once "../lib/tb_functions.php";

$configName=$_REQUEST["config"];
if ($configName == "" )
	$configName="tbconfig";

$tb_config = ReadConfig($configName);

if ( $_POST["UPDATEKEY" ] == "yes")
{
	updateToken( $tb_config);
	SaveConfig($configName, $tb_config );
	// print "$tb_baseurl/admin/debateshowconfig.php?config=$configName";
	header("Location:$tb_baseurl/admin/debateshowconfig.php?config=$configName");
	exit;
}	

// print "$tb_baseurl/admin/debateshowconfig.php?config=$configName";
UpdatePost2Config( $tb_config,"TB_");

SaveConfig($configName, $tb_config );


//print "AAAA<br>";
//PrintConfig($tb_config);

header("Location:$tb_baseurl/admin/debateshowconfig.php?config=$configName");

?>
